This page last changed on Mar 14, 2009 by dcameron.

Examples

Minimalist Example:

<rake />

Full example:

<rake>
  <executable>c:\ruby\bin\rake.bat</executable>
  <baseDirectory>c:\fromcvs\myrepo\myproject</baseDirectory>
  <buildArgs>additional-argument</buildArgs>
  <rakefile>Rakefile</rakefile>
  <targetList>
    <target>build</target>
  </targetList>
  <buildTimeoutSeconds>1200</buildTimeoutSeconds>
  <quiet>false</quiet>
  <silent>false></silent>
  <trace>true</trace>
</rake>

Configuration Elements:

Node Description Type Required Default
executable The path of the version of Rake you want to run. If this is relative, then must be relative to either (a) the base directory, (b) the CCNet Server application, or (c) if the path doesn't contain any directory details then can be available in the system or application's 'path' environment variable string false c:\ruby\bin\rake.bat
baseDirectory The directory to run the Rake process in. If relative, is a subdirectory of the Project Working Directory string false Project Working Directory
rakefile The name of the Rakefile to run, relative to the baseDirectory. string false no build file specified (Rake will use the default build file in the working directory)
buildArgs Any arguments to pass through to Rake (e.g to specify build properties) string false no args specified
buildTimeoutSeconds Number of seconds to wait before assuming that the process has hung and should be killed. int false 600 (10 minutes)
targetList A list of targets to be called. CruiseControl.NET does not call Rake once for each target, it uses the Rake feature of being able to specify multiple targets. string list false no targets specified (Rake will use the build's default target
trace Turns on invoke/execute tracing and enables full backtrace. bool false false
quiet Do not log messages to standard output. bool false false
silent Like quiet but also suppresses the 'in directory' announcement. bool false false
description If filled in, this will be shown in the buildstage as the process name
string
false
n/a

Accessing CruiseControl.NET build labels in Rake

CCNet will pass the current build label to Rake via the environment variable CCNetLabel. This means that you can access this variable to, for example, archive the build results in a folder with the same name as the build label (this is what we do on CCNetLive using NAnt. Here's some example Rakefile demonstrating how to do this:

#!ruby
require 'rake'

task :default => [:deploy]

task :deploy do
	publishdir="C:/download-area/CCNet-Builds/#{ENV['CCNetLabel']}"
	mkdir_p publishdir
	FileList['dist/*'].each do |file|
		cp file, publishdir
	end
end

Integration Properties

The following parameters are passed to Rake as environment variables:

Label Description Example
CCNetBuildCondition The condition used to trigger the build, indicating if the build was triggered by new modifications or if it was forced. Legal values are: "IfModificationExists" or "ForceBuild" ForceBuild
CCNetIntegrationStatus The status of the current integration. Could be Success, Failure, Exception or Unknown Success
CCNetLabel The label used to identify the CCNet build. This label is generated by the CCNet labeller. 1.0.2.120
CCNetLastIntegrationStatus The status of the previous integration. Could be Success, Failure, Exception or Unknown Success
CCNetProject The name of the CCNet project that is being integrated. MyProject
CCNetBuildDate The date of the build (in yyyy-MM-dd format) 2005-08-10
CCNetBuildTime The time of the start of the build (in HH:mm:ss format) 08:45:12
CCNetArtifactDirectory The project artifact directory (as an absolute path) c:\program files\CruiseControl.NET\Server\MyProject\Artifacts
CCNetWorkingDirectory The project working directory (as an absolute path) c:\program files\CruiseControl.NET\Server\MyProject\WorkingDirectory
CCNetRequestSource The source of the integration request; this will generally be the name of the trigger that raised the request. (Added in CCNet 1.1) IntervalTrigger
CCNetFailureUsers The list of users who have contributed modifications to a sequence of builds that has failed. John, Smith
CCNetListenerFile Viewing build progress with Nant and MSBuild (Added in CCNet 1.4) c:\Project\Artifact\listener.xml
CCNetProjectUrl The URL where the project is located http://myhost/ccnet/server/
CCNetNumericLabel Contains the label as an integer if conversion is possible, otherwise zero. 1
CCNetModifyingUsers
The list of users who have contributed to the current build only
Smith
Document generated by Confluence on Mar 14, 2009 02:55